#include <cstdlib>
#include <iostream>
#include <set>
#include <iterator>
using namespace std;
class node{
       //unsigned int i;
       //A list of parents
       set<int> p;
       //A list of children
       set<int> c;
       //A list of items associated directly to the node
       set<int> i;
       //public:
       //node();
      // node(set<int> a , set<int> b, set<int> c);
    public: node() {  // default constructor
        }
     node(set<int> a, set<int> b, set<int> c) {  // constructor
        p = a;
        c = b;
        i = c;
    }
    set<int> return_c(void){
               return c;
               }
    set<int> return_p(void){
               return p;
               }
       set<int> return_i(void){
               return i;
               }
       void add_p(int input){
            p.insert(input);
       }
       void add_p(set<int> input){
            p.insert(input.begin(),input.end());
       }
       void remove_p(int input){
            p.erase(input);
       }
       void remove_p(set<int> input){
            p.erase(input.begin(),input.end());
       }
       
       void add_c(int input){
            c.insert(input);
       }
       void add_c(set<int> input){
            c.insert(input.begin(),input.end());
       }
       void remove_c(int input){
            c.erase(input);
       }
       void remove_c(set<int> input){
            c.erase(input.begin(),input.end());
       }
       
       
       void add_i(int input){
            i.insert(input);
       }
       void add_i(set<int> input){
            i.insert(input.begin(),input.end());
       }
       void remove_i(int input){
            i.erase(input);
       }
       void remove_i(set<int> input){
            i.erase(input.begin(),input.end());
       }
       
       //
       void print(){
            set<int>::iterator itr;
            cout<< "parents\n";
            for(itr = p.begin(); itr!=p.end(); itr++){
                    cout<<*itr;
                    cout<<",";
            }
       
            cout<< "\nchildren\n";
            for(itr = c.begin(); itr!=c.end(); itr++){
                    cout<<*itr;
                    cout<<",";
            }
            cout<< "\nitems\n";
            for(itr = i.begin(); itr!=i.end(); itr++){
                    cout<<*itr;
                    cout<<",";
            }
            cout<<"\n";
       }
       
};
